import { updateClassComponent, updateFunctionCompoent, updateHostComponent, updateHostText } from "./reaconciler";
import { ClassComponent, FunctionComponent, HostComponent, HostText } from "./workTags";
import { IFiber } from "./updateContainer";

export function beginWork(fiber: IFiber) {
  const tag = fiber.tag;

  switch (tag) {
    case HostComponent: {
      updateHostComponent(fiber);
      break;
    }
    case HostText: {
      updateHostText(fiber);
      break;
    }
    case FunctionComponent: {
      updateFunctionCompoent(fiber);
      break;
    }
    case ClassComponent: {
      updateClassComponent(fiber);
      break;
    }
  }
}
